/**  
 *	VisualGroup JavaScript prototype Classes, version 0.1
 *  (c) 2008 Bill Vison <vison_ruan@126.com>
 *	new authorising manager factory defined 
 *
/*--------------------------------------------------------------------------*/
using("Vsg");
using("Vsg.AuthorisingManager");
Vsg.AuthorisingManagerFactory = {
	newManagerInstance:function($rules) {
		var $managerInstance = null;
		try {
			$managerInstance = new Vsg.AuthorisingManager();
			if ($rules != undefined) {
				for (var $i = 0 ; $i < $rules.length ; $i++) {
					$managerInstance.addRule( $rules[$i] );
				}
			}
			$managerInstance.fireEvent("init" , $managerInstance);
		} catch (ex) {
			if (ex instanceof Vsg.AuthorisingManager.AuthorisingManagerException) {
				throw ex;
			}
		}
		
		return $managerInstance;
	}
};
